"""
Processor类 - 不使用__init__.py版本
"""

class Processor:
    """数据处理器类，提供各种数据处理方法"""
    
    def __init__(self, mode="default"):
        self.mode = mode
        self.processed_count = 0
        print(f"Processor 已初始化，模式: {self.mode}")
    
    def process_text(self, text):
        """处理文本数据"""
        if not isinstance(text, str):
            raise TypeError("输入必须是字符串")
        
        result = text.upper() if self.mode == "uppercase" else text.lower()
        self.processed_count += 1
        print(f"处理文本: '{text}' -> '{result}'")
        return result
    
    def process_numbers(self, numbers):
        """处理数字列表"""
        if not isinstance(numbers, list):
            raise TypeError("输入必须是列表")
        
        if self.mode == "sum":
            result = sum(numbers)
        elif self.mode == "multiply":
            result = 1
            for num in numbers:
                result *= num
        else:
            result = numbers
        
        self.processed_count += 1
        print(f"处理数字: {numbers} -> {result}")
        return result
    
    def get_stats(self):
        """获取处理统计信息"""
        return {
            "mode": self.mode,
            "processed_count": self.processed_count
        }

# 版本信息只能在每个文件中单独维护
MODULE_VERSION = "1.0.0" 